Skip to content

dia: diaPASEF run 72 -> 50 min, byte-identical outputs (parallel PIN I/O, predict, pool scores, rescoring overlap) - #571

Merged
ypriverol merged 22 commits into
mainfrom
perf/diapasef-fast
Nov 25, 2026
Merged

ypriverol merged 22 commits into
mainfrom
perf/diapasef-fast

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

Makes a diaPASEF run faster with byte-identical outputs.

On PXD062685 Condition A Sample Alpha 01 (16 CPUs, native rescoring), the run takes 50:25 instead of 1:12:12 (−30 %). Peak RSS drops from 62.4 to 60.2 GB. The outputs digest over all 13 output files is unchanged (a78fefbc…). The PB-Astral dev slice digest is also unchanged.

Stage (s) main this PR
search 1349 1310 (noise)
PIN write + statistics 158 68
predict MS2/RT 1003 577
pool scores 322 104
pass 2 392 328
keep 10 per scan 191 45
co-elution 61 28
pass-1 rescoring to precursor q 268 233
precursor PIN build 371 134
total wall 4332 3025
CPU (user+sys) 38,897 33,588

IDs at q ≤ 0.01 are the same on both: 70,639 precursors, 664,545 PSMs and 9,320 protein groups.

Changes

  • Text PIN I/O: the PIN is read, rewritten and re-ranked in 64 MB blocks of lines that are parsed in parallel (read_pin, write_pin, rerank_pin). The same applies to precursor-level q, the RT refit and the precursor PIN, which no longer load the whole file. These steps used to run on about one core.
  • Predict:
    • Each row's RT is calibrated in parallel.
    • Median imputation runs four columns at a time.
    • Evidence traces walk each scan once, in fragment m/z order, instead of a binary search per fragment and scan.
    • On DIA, the MS2 features read the observed intensities from the row's own scan trace.
  • Pool scores: each pass computes ions only for the rows it uses (anchors for the m/z shift, anchors and decoys for the counts).
  • Rescoring:
    • The DIA peaks are freed before pass-1 Percolator.
    • The precursor learned score trains while pass 1 is rescored.
  • PIN write and statistics:
    • The RT and provenance features are filled per spectrum in parallel.
    • The run statistics read each spectrum's best PSM in parallel.
    • The DIA PSM queues are dropped in parallel.
  • Pass 2: a nominee ion's weight is +0 when its prediction is not positive. f32::max leaves the sign of a zero to the build, and one build wrote -0.0 for 17 values.
  • File budget: the PIN reader moves to dia/pin.rs, so dia/rt.rs stays under the file-size budget.

Not done

  • AVX-512 for the MS2 kernel (it needs Rust 1.89).
  • Larger kernel tiles (the kernel is limited by compute).
  • A cross-chunk prediction cache (forms rarely recur between chunks).
  • Merging the predict and pool rewrites (about 10 GB more at peak).
  • Percolator and GBDT internals (they could change results).

The search, now 43 % of wall time, is the next step.

…s for the m/z shift, anchors and decoys for the counts)
…ecursor learned score while pass 1 is rescored
…SM in parallel; the DIA PSM queues are dropped in parallel
…he row's own scan trace instead of searching the scan again
…ositive (f32::max leaves the sign of a zero to the build)
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 719fa61d-5d3a-4bbb-ab43-82c2e25298a5
Commits

Reviewing files that changed from the base of the PR and between a5506e9 and f59ea3e.

Files selected for processing: 14

  • crates/andes/src/bin/andes/dia.rs
  • crates/andes/src/bin/andes/dia/blocks.rs
  • crates/andes/src/bin/andes/dia/llr.rs
  • crates/andes/src/bin/andes/dia/pass2.rs
  • crates/andes/src/bin/andes/dia/pin.rs
  • crates/andes/src/bin/andes/dia/rt.rs
  • crates/andes/src/bin/andes/dia/score.rs
  • crates/andes/src/bin/andes/dia/tests/dia.rs
  • crates/andes/src/bin/andes/search/finish.rs
  • crates/andes/src/bin/andes/search/rescoring.rs
  • crates/onnx-infer/src/predictors/spectral.rs
  • crates/output/src/provenance.rs
  • crates/output/src/rt.rs
  • crates/output/src/statistics.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@ypriverol
ypriverol merged commit cddbcc7 into main Nov 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant